import { useSelector, useDispatch } from 'react-redux'
import { decrement, increment } from '@/store/modules/counterSlice'
import { Link } from 'react-router-dom'
import { Button } from 'antd';
import Test from '@/components/test';
export default function Home(){
    const count = useSelector(state => state.counter.value)
    const dispatch = useDispatch()
    return (
      <div>
         <Link to="/setting">Setting</Link>
            <div>
                <Button
                    aria-label="Increment value"
                    onClick={() => dispatch(increment())}
                >
                    Increment
                </Button>
                <span>{count}</span>
                <Button
                    aria-label="Decrement value"
                    onClick={() => dispatch(decrement())}
                >
                    Decrement
              </Button>
              <Test/>
            </div>
        </div>
    )
}